package cn.zhz.dao;

import cn.zhz.pojo.House;

import cn.zhz.pojo.HouseCondition;
import org.hibernate.Query;
import java.util.List;

public class HouseDao extends BaseDao{
    public List<House> findKeyInfo(House house){
        String hql = "from House where title like ? and floorage > ?";
        Query query = currentSession().createQuery(hql);
        query.setString(0,house.getTitle());
        query.setInteger(1,house.getFloorage());
        return query.list();
    }

    public List<House> findByConditions(String hql, HouseCondition condition){
        return currentSession().createQuery(hql).setProperties(condition).list();
    }
}
